package object;

public class Calculator {
    //属性:就是变量
    private String brand;
    private double size;

    //加法运算功能
    public void add(int a, int b) {
        System.out.println(a + "+" + b + "=" + (a + b));
    }

    //减法运算功能
    public void sub(int a, int b) {
        System.out.println(a + "-" + b + "=" + (a - b));
    }

    //显示计算器信息功能
    public void show() {
        System.out.println("品牌：" + brand);
        System.out.println("尺寸：" + size);
    }

    public Calculator() {
    }

    public String getBrand() {
        return brand;
    }

    public void setBrand(String brand) {
        this.brand = brand;
    }

    public double getSize() {
        return size;
    }

    public void setSize(double size) {
        this.size = size;
    }

    public Calculator(String brand, double size) {
        this.brand = brand;
        this.size = size;
    }
}
